package com.lyeducation.entities.system;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

public class UserconnectionEntityPK implements Serializable {
    private String userId;
    private String providerId;
    private String providerUserId;

    @Column(name = "userId", nullable = false, length = 255)
    @Id
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Column(name = "providerId", nullable = false, length = 255)
    @Id
    public String getProviderId() {
        return providerId;
    }

    public void setProviderId(String providerId) {
        this.providerId = providerId;
    }

    @Column(name = "providerUserId", nullable = false, length = 255)
    @Id
    public String getProviderUserId() {
        return providerUserId;
    }

    public void setProviderUserId(String providerUserId) {
        this.providerUserId = providerUserId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UserconnectionEntityPK that = (UserconnectionEntityPK) o;
        return Objects.equals(userId, that.userId)
                && Objects.equals(providerId, that.providerId)
                && Objects.equals(providerUserId, that.providerUserId);
    }

    @Override
    public int hashCode() {

        return Objects.hash(userId, providerId, providerUserId);
    }
}
